Skip to content

feat: add SSE stream endpoint with GitHub webhook and polling fallback#998

Open
devendra-w wants to merge 7 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/sse-stream-clean
Open

feat: add SSE stream endpoint with GitHub webhook and polling fallback#998
devendra-w wants to merge 7 commits into
Priyanshu-byte-coder:mainfrom
devendra-w:feat/sse-stream-clean

Conversation

@devendra-w
Copy link
Copy Markdown
Contributor

Summary

Adds a Server-Sent Events (SSE) stream endpoint with GitHub webhook integration and polling fallback for real-time dashboard updates.

Closes #237

Type of Change

  • New feature

Changes Made

  • Added src/app/api/stream/route.ts - SSE endpoint with auth check, session ownership verification, and cleanup on disconnect
  • Added src/app/api/webhooks/github/route.ts - GitHub webhook handler that pushes events to connected SSE clients
  • Added src/lib/sse.ts - in-memory SSE connections map
  • Added src/components/SSEListener.tsx - client component that connects to the SSE stream with polling fallback
  • Added test/github-webhook.test.ts - unit tests for webhook handler
  • Updated src/app/dashboard/page.tsx - added SSEListener with session.githubId

How to Test

  1. Sign in and navigate to /dashboard
  2. Open browser DevTools → Network tab
  3. Look for a request to /api/stream with type eventsource
  4. Verify it stays connected

Checklist

  • Linked issue in summary
  • Self-reviewed the diff
  • Added tests

@vercel
Copy link
Copy Markdown

vercel Bot commented May 25, 2026

@devendra-w is attempting to deploy a commit to the PRIYANSHU DOSHI's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions github-actions Bot added gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts) labels May 25, 2026
@github-actions
Copy link
Copy Markdown

GSSoC Label Checklist 🏷️

@Priyanshu-byte-coder — please apply the appropriate labels before merging:

Difficulty (pick one):

  • level:beginner — 20 pts
  • level:intermediate — 35 pts
  • level:advanced — 55 pts
  • level:critical — 80 pts

Quality (optional):

  • quality:clean — ×1.2 multiplier
  • quality:exceptional — ×1.5 multiplier

Validation (required to score):

  • gssoc:approved — counts for points
  • gssoc:invalid / gssoc:spam / gssoc:ai-slop — does not score

Type labels (type:*) are auto-detected from files and title. Review and adjust if needed.
Points formula: (difficulty × quality_multiplier) + type_bonus

@devendra-w
Copy link
Copy Markdown
Contributor Author

Hi @Priyanshu-byte-coder! This is a clean rebase of #299 on the latest main. All CI checks are passing. Ready for review!

@devendra-w
Copy link
Copy Markdown
Contributor Author

@Priyanshu-byte-coder could you please re-add the gssoc:approved and difficulty labels to this PR? This is a clean rebase of the previously approved PR.

@Priyanshu-byte-coder
Copy link
Copy Markdown
Owner

Hi! The Playwright smoke tests are failing on this PR. Please investigate the test failures — check the CI logs linked in the checks above, fix any broken tests, and push an update. We can't merge while tests are red. Happy to help if you share what the failure output shows!

@devendra-w
Copy link
Copy Markdown
Contributor Author

Hey @Priyanshu-byte-coder
Fixed the Playwright test failures:
Added SSE stream route mock to beforeEach so SSEListener doesn't error in the test environment
Removed duplicate test title in landing.spec.js
Fixed footer test strict mode violation by targeting footer.first()
Resolved merge conflict in src/app/api/webhooks/github/route.ts using main's shared verifyGitHubSignature from @/lib/crypto
Ready for merge!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gssoc26 GSSoC 2026 contribution type:feature GSSoC type bonus: new feature type:testing GSSoC type bonus: tests (+10 pts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEAT] Add server-sent events (SSE) endpoint for real-time dashboard refresh

2 participants